var constant = require('../common/constant');

module.exports =function (req,res,next){
    console.log('login interceptor');
    if(req.session.merchant){
        console.log('isLogin');
        next();
    }else{
        console.log('noLogin');
        var response = {};
        response.result=false;
        response.code = constant.noLogin;
        res.json(response);
    }
}